package com.demo;

import com.demo.binder.Demo;
import com.demo.binder.MyProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class C3Application {
    @Autowired
    Environment environment;

    @Autowired
    MyProperties myProperties;

    @Autowired
    Demo demo;

    public static void main(String[] args) {
        SpringApplication.run(C3Application.class,args);
    }

    @Bean
    public ApplicationRunner run(){
        return f -> {
            System.out.println("------"+myProperties.getName());
            System.out.println("------"+Demo.getName());
        };
    }
}
